<%@ page import="java.util.List" %>
<%@ page import="java.util.ArrayList" %>
<%@ page import="com.homework.bin.user" %>
<%--Created by IntelliJ IDEA.
  User: Administrator
  Date: 2021/5/18
  Time: 19:46
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<jsp:useBean class="com.homework.dao.userdao" id="userdao"></jsp:useBean>
<html>
<head>
    <title>用户列表</title>
</head>
<body>
<table border align="center" width="20%">
    <caption>用户列表</caption>
    <tr><th>id</th><th>用户名</th><th>密码</th>
<%
    List<user> userList=new ArrayList<>();
    userList=userdao.result();
    for(user user : userList){
%>
    <tr><td><%=user.getId()%></td>
    <td><%=user.getUsername()%></td>
    <td><%=user.getPassword()%></td></tr>
<%}%>
</table>
</body>
</html>
